import {NgModule} from '@angular/core';
import {RouterModule, Routes} from "@angular/router";
import {CustomerComponent} from "./customer.component";
import {CustomerDetailComponent} from "./customer-detail/customer-detail.component";
import {CustomerListComponent} from "./customer-list/customer-list.component";
import {CustomerDialogComponent} from "./customer-dialog/customer-dialog.component";
import {CustomerResolver} from "./customer.resolver";
import { NzMessageModule } from 'ng-zorro-antd/message';
import { NzModalModule } from 'ng-zorro-antd/modal';
import { NzBreadCrumbModule } from 'ng-zorro-antd/breadcrumb';
import { NzTableModule } from 'ng-zorro-antd/table';
import { NzToolTipModule } from 'ng-zorro-antd/tooltip';
import { NzSelectModule } from 'ng-zorro-antd/select';
import { NzLayoutModule } from 'ng-zorro-antd/layout';
import { NzButtonModule } from 'ng-zorro-antd/button';
import { NzInputModule } from 'ng-zorro-antd/input';
import { NzRadioModule } from 'ng-zorro-antd/radio';
import { NzFormModule } from 'ng-zorro-antd/form';
import { NzIconModule } from 'ng-zorro-antd/icon';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';

const routes: Routes = [
    {
        path: '',
        component: CustomerComponent,
        children: [
            {
                path: 'detail/:id',
                data:{ title: 'Custom-Detail'},
                component: CustomerDetailComponent,
                resolve: {
                    data: CustomerResolver
                }
            },
            {
                path: 'list',
                data:{ title: 'Custom-List'},
                component: CustomerListComponent,
            },
            {
                path: '**',
                redirectTo: 'list'
            }
        ]
    }
];

@NgModule({
    declarations: [CustomerComponent, CustomerListComponent, CustomerDetailComponent, CustomerDialogComponent],
    providers: [CustomerResolver],
    imports: [
        RouterModule.forChild(routes),
        CommonModule,
        FormsModule,
        NzMessageModule,
        NzModalModule,
        NzBreadCrumbModule,
        NzTableModule,
        NzToolTipModule,
        NzSelectModule,
        NzButtonModule,
        NzInputModule,
        NzRadioModule,
        NzFormModule,
        NzIconModule,
        NzLayoutModule
    ]
})
export class CustomerModule {
}
